//
//  GAKKIBaseLabel.m
//  GANGAIKit
//
//  Created by fh on 2019/11/6.
//  Copyright © 2019 cashchina. All rights reserved.
//

#import "GAKKIBaseLabel.h"

@implementation GAKKIBaseLabel
- (void)dealloc {
    if (kDebugViewRelease) {
#ifdef DEBUG
        DBLog(@"\n ----------- 标签 %@ 销毁了 ----------- \n",[self class]);
#endif
    }
}

+ (instancetype)initGAKKIBaseLabel {
    GAKKIBaseLabel *label = [GAKKIBaseLabel new];
    label.font = [UIFont systemFontOfSize:16];
    label.textColor = [UIColor blackColor];
    label.numberOfLines = 0;
    label.textAlignment = NSTextAlignmentLeft;
    return label;
}


+ (GAKKIBaseLabel *)gakki_makeLabel:(void (^)(GAKKIBaseLabel * _Nonnull))block {
    GAKKIBaseLabel *label = [GAKKIBaseLabel initGAKKIBaseLabel];
    if (block) {
        block(label);
    }
    return label;
}

- (GAKKILabelFrame)gakki_frame {
    return ^(CGRect frame) {
        self.frame = frame;
        return self;
    };
}
- (GAKKILabelBackgroundColor)gakki_backgroundColor {
    return ^(UIColor * __nullable backgroundColor) {
        self.backgroundColor = backgroundColor;
        return self;
    };
}
- (GAKKILabelText)gakki_text {
    return ^(NSString * __nullable text) {
        self.text = text;
        return self;
    };
}
- (GAKKILabelFont)gakki_font {
    return ^(UIFont * __nullable font) {
        self.font = font;
        return self;
    };
}
- (GAKKILabelTextColor)gakki_textColor {
    return ^(UIColor * __nullable textColor) {
        self.textColor = textColor;
        return self;
    };
}
- (GAKKILabelTextAlignment)gakki_textAlignment {
    return ^(NSTextAlignment textAlignment) {
        self.textAlignment = textAlignment;
        return self;
    };
}
- (GAKKILabelAttributedString)gakki_attributedText {
    return ^(NSAttributedString * __nullable attributedText) {
        self.attributedText = attributedText;
        return self;
    };
}
- (GAKKILabelNumberOfLines)gakki_numberOfLines {
    return ^(NSInteger numberOfLines) {
        self.numberOfLines = numberOfLines;
        return self;
    };
}

@end
